include(FetchContent)

set(LIBTORCH_PKG_URL "https://download.pytorch.org/libtorch/nightly/cu124/libtorch-cxx11-abi-shared-with-deps-latest.zip")

set(TORCH_SOURCE_DIR "${PROJECT_SOURCE_DIR}/fetchcontent/libtorch")
FetchContent_Declare(
    libtorch
    URL ${LIBTORCH_PKG_URL}
    SOURCE_DIR ${TORCH_SOURCE_DIR}
)

message(STATUS "Downloading libtorch from ${LIBTORCH_PKG_URL}")
FetchContent_MakeAvailable(libtorch)
